using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VFGBST
    {
        public DataRow Convert2FGBST(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryFGBST(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["FGMANDANT"] = " ".PadRight(2 ); 
         dwReturn["FGSA"] = " ".PadRight(2 ); 
         dwReturn["FGART"] = " ".PadRight(20 ); 
         dwReturn["FGVAR"] = " ".PadRight(2 ); 
         dwReturn["FGFARBE"] = " ".PadRight(10 ); 
         dwReturn["FGGROE"] = " ".PadRight(7 ); 
         dwReturn["FGAUFM"] = " ".PadRight(2 ); 
         dwReturn["FGVPEINH"] = " ".PadRight(3 ); 
         dwReturn["FGZS"] = " ".PadRight(2 ); 
         dwReturn["FGLO"] = " ".PadRight(2 ); 
         dwReturn["FGMJJ"] = " ".PadRight(0 ); 
         dwReturn["FGMM"] = " ".PadRight(0 ); 
         dwReturn["FGAKTKZ"] = " ".PadRight(1 ); 
         dwReturn["FGME01"] = " ".PadRight(0 ); 
         dwReturn["FGME10"] = " ".PadRight(0 ); 
         dwReturn["FGME11"] = " ".PadRight(0 ); 
         dwReturn["FGME12"] = " ".PadRight(0 ); 
         dwReturn["FGME13"] = " ".PadRight(0 ); 
         dwReturn["FGME19"] = " ".PadRight(0 ); 
         dwReturn["FGME20"] = " ".PadRight(0 ); 
         dwReturn["FGME21"] = " ".PadRight(0 ); 
         dwReturn["FGME24"] = " ".PadRight(0 ); 
         dwReturn["FGME31"] = " ".PadRight(0 ); 
         dwReturn["FGME32"] = " ".PadRight(0 ); 
         dwReturn["FGME33"] = " ".PadRight(0 ); 
         dwReturn["FGME34"] = " ".PadRight(0 ); 
         dwReturn["FGME35"] = " ".PadRight(0 ); 
         dwReturn["FGME36"] = " ".PadRight(0 ); 
         dwReturn["FGME42"] = " ".PadRight(0 ); 
         dwReturn["FGME43"] = " ".PadRight(0 ); 
         dwReturn["FGME46"] = " ".PadRight(0 ); 
         dwReturn["FGME47"] = " ".PadRight(0 ); 
         dwReturn["FGME52"] = " ".PadRight(0 ); 
         dwReturn["FGME53"] = " ".PadRight(0 ); 
         dwReturn["FGME55"] = " ".PadRight(0 ); 
         dwReturn["FGME56"] = " ".PadRight(0 ); 
         dwReturn["FGMEIV"] = " ".PadRight(0 ); 
         dwReturn["FGME76"] = " ".PadRight(0 ); 
         dwReturn["FGME79"] = " ".PadRight(0 ); 
         dwReturn["FGME80"] = " ".PadRight(0 ); 
         dwReturn["FGME88"] = " ".PadRight(0 ); 
         dwReturn["FGME89"] = " ".PadRight(0 ); 
         dwReturn["FGME90"] = " ".PadRight(0 ); 
         dwReturn["FGME91"] = " ".PadRight(0 ); 
         dwReturn["FGRE01"] = " ".PadRight(0 ); 
         dwReturn["FGRE02"] = " ".PadRight(0 ); 
         dwReturn["FGRE03"] = " ".PadRight(0 ); 
         dwReturn["FGRE04"] = " ".PadRight(0 ); 
         dwReturn["FGRE05"] = " ".PadRight(0 ); 
         dwReturn["FGRE06"] = " ".PadRight(0 ); 
         dwReturn["FGRE07"] = " ".PadRight(0 ); 
         dwReturn["FGRE08"] = " ".PadRight(0 ); 
         dwReturn["FGRE09"] = " ".PadRight(0 ); 
         dwReturn["FGRE10"] = " ".PadRight(0 ); 
         dwReturn["FGBSTKMA"] = " ".PadRight(0 ); 
         dwReturn["FGBSTKME"] = " ".PadRight(0 ); 
         dwReturn["FGBSTVMA"] = " ".PadRight(0 ); 
         dwReturn["FGBSTVME"] = " ".PadRight(0 ); 
         dwReturn["FGBSTA"] = " ".PadRight(0 ); 
         dwReturn["FGBSTAN"] = " ".PadRight(0 ); 
         dwReturn["FGBSTMA"] = " ".PadRight(0 ); 
         dwReturn["FGBSTME"] = " ".PadRight(0 ); 
         dwReturn["FGINDAT"] = " ".PadRight(0 ); 
         dwReturn["FGINBST"] = " ".PadRight(0 ); 
         dwReturn["FGINALT"] = " ".PadRight(0 ); 
         dwReturn["FGEKPRMA"] = " ".PadRight(0 ); 
         dwReturn["FGEKPRME"] = " ".PadRight(0 ); 
         dwReturn["FGEKPRZU"] = " ".PadRight(0 ); 
         dwReturn["FGVRPR"] = " ".PadRight(0 ); 
         dwReturn["FGDLABST"] = " ".PadRight(0 ); 
         dwReturn["FGDLATAG"] = " ".PadRight(2 ); 
         dwReturn["FGMINBST"] = " ".PadRight(0 ); 
         dwReturn["FGMAXBST"] = " ".PadRight(0 ); 
         dwReturn["FGFERTKZ"] = " ".PadRight(1 ); 
         dwReturn["FGUEBER"] = " ".PadRight(1 ); 
         dwReturn["FGFILLER"] = " ".PadRight(25 ); 
         dwReturn["FGAENDZL"] = " ".PadRight(0 ); 
         dwReturn["FGAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["FGAENDDAT"] = " ".PadRight(0 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapFGBST(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveFGBST(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryFGBST(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapFGBST(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertFGBST(dwLocal, ITXDBVERSION);
            }
            UpdateFGBST(dwLocal);
        }
        public void InsertFGBST(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO FGBST(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryFGBST(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM FGBST WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM FGBST  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "FGBST";
            Return = Result;
            return Return;
        }
        public void DeleteFGBST(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM FGBST   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateFGBST(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE FGBST SET "
                    +"FGMANDANT= :FGMANDANT,"
                    +"FGSA= :FGSA,"
                    +"FGART= :FGART,"
                    +"FGVAR= :FGVAR,"
                    +"FGFARBE= :FGFARBE,"
                    +"FGGROE= :FGGROE,"
                    +"FGAUFM= :FGAUFM,"
                    +"FGVPEINH= :FGVPEINH,"
                    +"FGZS= :FGZS,"
                    +"FGLO= :FGLO,"
                    +"FGMJJ= :FGMJJ,"
                    +"FGMM= :FGMM,"
                    +"FGAKTKZ= :FGAKTKZ,"
                    +"FGME01= :FGME01,"
                    +"FGME10= :FGME10,"
                    +"FGME11= :FGME11,"
                    +"FGME12= :FGME12,"
                    +"FGME13= :FGME13,"
                    +"FGME19= :FGME19,"
                    +"FGME20= :FGME20,"
                    +"FGME21= :FGME21,"
                    +"FGME24= :FGME24,"
                    +"FGME31= :FGME31,"
                    +"FGME32= :FGME32,"
                    +"FGME33= :FGME33,"
                    +"FGME34= :FGME34,"
                    +"FGME35= :FGME35,"
                    +"FGME36= :FGME36,"
                    +"FGME42= :FGME42,"
                    +"FGME43= :FGME43,"
                    +"FGME46= :FGME46,"
                    +"FGME47= :FGME47,"
                    +"FGME52= :FGME52,"
                    +"FGME53= :FGME53,"
                    +"FGME55= :FGME55,"
                    +"FGME56= :FGME56,"
                    +"FGMEIV= :FGMEIV,"
                    +"FGME76= :FGME76,"
                    +"FGME79= :FGME79,"
                    +"FGME80= :FGME80,"
                    +"FGME88= :FGME88,"
                    +"FGME89= :FGME89,"
                    +"FGME90= :FGME90,"
                    +"FGME91= :FGME91,"
                    +"FGRE01= :FGRE01,"
                    +"FGRE02= :FGRE02,"
                    +"FGRE03= :FGRE03,"
                    +"FGRE04= :FGRE04,"
                    +"FGRE05= :FGRE05,"
                    +"FGRE06= :FGRE06,"
                    +"FGRE07= :FGRE07,"
                    +"FGRE08= :FGRE08,"
                    +"FGRE09= :FGRE09,"
                    +"FGRE10= :FGRE10,"
                    +"FGBSTKMA= :FGBSTKMA,"
                    +"FGBSTKME= :FGBSTKME,"
                    +"FGBSTVMA= :FGBSTVMA,"
                    +"FGBSTVME= :FGBSTVME,"
                    +"FGBSTA= :FGBSTA,"
                    +"FGBSTAN= :FGBSTAN,"
                    +"FGBSTMA= :FGBSTMA,"
                    +"FGBSTME= :FGBSTME,"
                    +"FGINDAT= :FGINDAT,"
                    +"FGINBST= :FGINBST,"
                    +"FGINALT= :FGINALT,"
                    +"FGEKPRMA= :FGEKPRMA,"
                    +"FGEKPRME= :FGEKPRME,"
                    +"FGEKPRZU= :FGEKPRZU,"
                    +"FGVRPR= :FGVRPR,"
                    +"FGDLABST= :FGDLABST,"
                    +"FGDLATAG= :FGDLATAG,"
                    +"FGMINBST= :FGMINBST,"
                    +"FGMAXBST= :FGMAXBST,"
                    +"FGFERTKZ= :FGFERTKZ,"
                    +"FGUEBER= :FGUEBER,"
                    +"FGFILLER= :FGFILLER,"
                    +"FGAENDZL= :FGAENDZL,"
                    +"FGAENDBEN= :FGAENDBEN,"
                    +"FGAENDDAT= :FGAENDDAT,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("FGMANDANT", OracleType.NVarChar).Value = dwData["FGMANDANT"].ToString(); 
          or1.Parameters.Add("FGSA", OracleType.NVarChar).Value = dwData["FGSA"].ToString(); 
          or1.Parameters.Add("FGART", OracleType.NVarChar).Value = dwData["FGART"].ToString(); 
          or1.Parameters.Add("FGVAR", OracleType.NVarChar).Value = dwData["FGVAR"].ToString(); 
          or1.Parameters.Add("FGFARBE", OracleType.NVarChar).Value = dwData["FGFARBE"].ToString(); 
          or1.Parameters.Add("FGGROE", OracleType.NVarChar).Value = dwData["FGGROE"].ToString(); 
          or1.Parameters.Add("FGAUFM", OracleType.NVarChar).Value = dwData["FGAUFM"].ToString(); 
          or1.Parameters.Add("FGVPEINH", OracleType.NVarChar).Value = dwData["FGVPEINH"].ToString(); 
          or1.Parameters.Add("FGZS", OracleType.NVarChar).Value = dwData["FGZS"].ToString(); 
          or1.Parameters.Add("FGLO", OracleType.NVarChar).Value = dwData["FGLO"].ToString(); 
          or1.Parameters.Add("FGMJJ", OracleType.NVarChar).Value = dwData["FGMJJ"].ToString(); 
          or1.Parameters.Add("FGMM", OracleType.NVarChar).Value = dwData["FGMM"].ToString(); 
          or1.Parameters.Add("FGAKTKZ", OracleType.NVarChar).Value = dwData["FGAKTKZ"].ToString(); 
          or1.Parameters.Add("FGME01", OracleType.NVarChar).Value = dwData["FGME01"].ToString(); 
          or1.Parameters.Add("FGME10", OracleType.NVarChar).Value = dwData["FGME10"].ToString(); 
          or1.Parameters.Add("FGME11", OracleType.NVarChar).Value = dwData["FGME11"].ToString(); 
          or1.Parameters.Add("FGME12", OracleType.NVarChar).Value = dwData["FGME12"].ToString(); 
          or1.Parameters.Add("FGME13", OracleType.NVarChar).Value = dwData["FGME13"].ToString(); 
          or1.Parameters.Add("FGME19", OracleType.NVarChar).Value = dwData["FGME19"].ToString(); 
          or1.Parameters.Add("FGME20", OracleType.NVarChar).Value = dwData["FGME20"].ToString(); 
          or1.Parameters.Add("FGME21", OracleType.NVarChar).Value = dwData["FGME21"].ToString(); 
          or1.Parameters.Add("FGME24", OracleType.NVarChar).Value = dwData["FGME24"].ToString(); 
          or1.Parameters.Add("FGME31", OracleType.NVarChar).Value = dwData["FGME31"].ToString(); 
          or1.Parameters.Add("FGME32", OracleType.NVarChar).Value = dwData["FGME32"].ToString(); 
          or1.Parameters.Add("FGME33", OracleType.NVarChar).Value = dwData["FGME33"].ToString(); 
          or1.Parameters.Add("FGME34", OracleType.NVarChar).Value = dwData["FGME34"].ToString(); 
          or1.Parameters.Add("FGME35", OracleType.NVarChar).Value = dwData["FGME35"].ToString(); 
          or1.Parameters.Add("FGME36", OracleType.NVarChar).Value = dwData["FGME36"].ToString(); 
          or1.Parameters.Add("FGME42", OracleType.NVarChar).Value = dwData["FGME42"].ToString(); 
          or1.Parameters.Add("FGME43", OracleType.NVarChar).Value = dwData["FGME43"].ToString(); 
          or1.Parameters.Add("FGME46", OracleType.NVarChar).Value = dwData["FGME46"].ToString(); 
          or1.Parameters.Add("FGME47", OracleType.NVarChar).Value = dwData["FGME47"].ToString(); 
          or1.Parameters.Add("FGME52", OracleType.NVarChar).Value = dwData["FGME52"].ToString(); 
          or1.Parameters.Add("FGME53", OracleType.NVarChar).Value = dwData["FGME53"].ToString(); 
          or1.Parameters.Add("FGME55", OracleType.NVarChar).Value = dwData["FGME55"].ToString(); 
          or1.Parameters.Add("FGME56", OracleType.NVarChar).Value = dwData["FGME56"].ToString(); 
          or1.Parameters.Add("FGMEIV", OracleType.NVarChar).Value = dwData["FGMEIV"].ToString(); 
          or1.Parameters.Add("FGME76", OracleType.NVarChar).Value = dwData["FGME76"].ToString(); 
          or1.Parameters.Add("FGME79", OracleType.NVarChar).Value = dwData["FGME79"].ToString(); 
          or1.Parameters.Add("FGME80", OracleType.NVarChar).Value = dwData["FGME80"].ToString(); 
          or1.Parameters.Add("FGME88", OracleType.NVarChar).Value = dwData["FGME88"].ToString(); 
          or1.Parameters.Add("FGME89", OracleType.NVarChar).Value = dwData["FGME89"].ToString(); 
          or1.Parameters.Add("FGME90", OracleType.NVarChar).Value = dwData["FGME90"].ToString(); 
          or1.Parameters.Add("FGME91", OracleType.NVarChar).Value = dwData["FGME91"].ToString(); 
          or1.Parameters.Add("FGRE01", OracleType.NVarChar).Value = dwData["FGRE01"].ToString(); 
          or1.Parameters.Add("FGRE02", OracleType.NVarChar).Value = dwData["FGRE02"].ToString(); 
          or1.Parameters.Add("FGRE03", OracleType.NVarChar).Value = dwData["FGRE03"].ToString(); 
          or1.Parameters.Add("FGRE04", OracleType.NVarChar).Value = dwData["FGRE04"].ToString(); 
          or1.Parameters.Add("FGRE05", OracleType.NVarChar).Value = dwData["FGRE05"].ToString(); 
          or1.Parameters.Add("FGRE06", OracleType.NVarChar).Value = dwData["FGRE06"].ToString(); 
          or1.Parameters.Add("FGRE07", OracleType.NVarChar).Value = dwData["FGRE07"].ToString(); 
          or1.Parameters.Add("FGRE08", OracleType.NVarChar).Value = dwData["FGRE08"].ToString(); 
          or1.Parameters.Add("FGRE09", OracleType.NVarChar).Value = dwData["FGRE09"].ToString(); 
          or1.Parameters.Add("FGRE10", OracleType.NVarChar).Value = dwData["FGRE10"].ToString(); 
          or1.Parameters.Add("FGBSTKMA", OracleType.NVarChar).Value = dwData["FGBSTKMA"].ToString(); 
          or1.Parameters.Add("FGBSTKME", OracleType.NVarChar).Value = dwData["FGBSTKME"].ToString(); 
          or1.Parameters.Add("FGBSTVMA", OracleType.NVarChar).Value = dwData["FGBSTVMA"].ToString(); 
          or1.Parameters.Add("FGBSTVME", OracleType.NVarChar).Value = dwData["FGBSTVME"].ToString(); 
          or1.Parameters.Add("FGBSTA", OracleType.NVarChar).Value = dwData["FGBSTA"].ToString(); 
          or1.Parameters.Add("FGBSTAN", OracleType.NVarChar).Value = dwData["FGBSTAN"].ToString(); 
          or1.Parameters.Add("FGBSTMA", OracleType.NVarChar).Value = dwData["FGBSTMA"].ToString(); 
          or1.Parameters.Add("FGBSTME", OracleType.NVarChar).Value = dwData["FGBSTME"].ToString(); 
          or1.Parameters.Add("FGINDAT", OracleType.NVarChar).Value = dwData["FGINDAT"].ToString(); 
          or1.Parameters.Add("FGINBST", OracleType.NVarChar).Value = dwData["FGINBST"].ToString(); 
          or1.Parameters.Add("FGINALT", OracleType.NVarChar).Value = dwData["FGINALT"].ToString(); 
          or1.Parameters.Add("FGEKPRMA", OracleType.NVarChar).Value = dwData["FGEKPRMA"].ToString(); 
          or1.Parameters.Add("FGEKPRME", OracleType.NVarChar).Value = dwData["FGEKPRME"].ToString(); 
          or1.Parameters.Add("FGEKPRZU", OracleType.NVarChar).Value = dwData["FGEKPRZU"].ToString(); 
          or1.Parameters.Add("FGVRPR", OracleType.NVarChar).Value = dwData["FGVRPR"].ToString(); 
          or1.Parameters.Add("FGDLABST", OracleType.NVarChar).Value = dwData["FGDLABST"].ToString(); 
          or1.Parameters.Add("FGDLATAG", OracleType.NVarChar).Value = dwData["FGDLATAG"].ToString(); 
          or1.Parameters.Add("FGMINBST", OracleType.NVarChar).Value = dwData["FGMINBST"].ToString(); 
          or1.Parameters.Add("FGMAXBST", OracleType.NVarChar).Value = dwData["FGMAXBST"].ToString(); 
          or1.Parameters.Add("FGFERTKZ", OracleType.NVarChar).Value = dwData["FGFERTKZ"].ToString(); 
          or1.Parameters.Add("FGUEBER", OracleType.NVarChar).Value = dwData["FGUEBER"].ToString(); 
          or1.Parameters.Add("FGFILLER", OracleType.NVarChar).Value = dwData["FGFILLER"].ToString(); 
          or1.Parameters.Add("FGAENDZL", OracleType.NVarChar).Value = dwData["FGAENDZL"].ToString(); 
          or1.Parameters.Add("FGAENDBEN", OracleType.NVarChar).Value = dwData["FGAENDBEN"].ToString(); 
          or1.Parameters.Add("FGAENDDAT", OracleType.NVarChar).Value = dwData["FGAENDDAT"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
